﻿using System;
using System.Data;
using BLL;
using Utils;
namespace UI.ModEmployee
{
    public partial class EmpJoinSummary: System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //JSUtility.AddReset(btnClear);
            }
        }

        protected void btnEmSearch_Click(object sender, EventArgs e)
        {
            
            string bTime = txtBtime.Text.Trim();
            string eTime = txtEtime.Text.Trim();
            DataTable dt = new EmployeeBiz().GetLists(bTime, eTime);
            if (dt.Rows.Count > 0)
            {
                lbAmount.Text = "合计：   " + dt.Rows.Count;
                gvList.DataSource = dt;
                gvList.DataBind();
            }
            else
            {
                lbAmount.Text = "";
                JSUtility.Alert(this, "没有符合条件的数据");
            }
        }

        protected void btnClear_Click(object sender, EventArgs e)
        {

        }
        //根据gridview打印
        protected void btnPrint_Click(object sender, EventArgs e)
        {
            ToolUtility.Printer("入职汇总", gvList);
        }
       
        protected void btnExcel_Click(object sender, EventArgs e)
        {
            ExcelUtility.GridViewToExcel(gvList, "EmpJoinSummary.xls");
        }
    }
}